import Vue from "vue";
import App from "./App";
// 中央控制总线
import store from "./store";
// 系统配置
import wanlshop_function from "./common/wanlshop_function";
import wanlshop_config from "./common/config/config";
import mpShare from "./common/libs/mixin/mpShare";
import md5Libs from "./common/md5";

// 引入JSSDK
// #ifdef H5
import jssdk from "@/common/libs/jssdk";
// #endif
// 1.1.3升级
import Base64 from "./common/base64";

// 小程序分享的mixin封装
Vue.mixin(mpShare);
// 阻止启动生产消息，常用作指令。
Vue.config.productionTip = wanlshop_config.debug;
// 挂载
Vue.prototype.$store = store; //挂载在 Vue 实例上
// #ifdef H5
Vue.prototype.$jssdk = jssdk;
// #endif
// 1.1.3升级
Vue.prototype.$base64 = new Base64();

/**
 * 导航栏的总高度
 */
Vue.prototype.$navigationHeight = uni.getSystemInfoSync()["statusBarHeight"] + 45;
/**
 * 存储信息
 */
import stoarge from "@/utils/stoarge.js";
Vue.prototype.$stoarge = stoarge;
/**
 * 吐司
 */
import st from "@/utils/showtoast.js";
Vue.prototype.$st = st;
/**
 * js方法
 */
import filters from "@/utils/filters.js";
Vue.prototype.$filters = filters;
/**
 * 跳转的js
 */
import jump from "@/utils/jump.js";
Vue.prototype.$jump = jump;
/**
 * 公共的网络请求
 */
import commonNetwork from "@/utils/commonNetwork.js";
Vue.prototype.$commonNetwork = commonNetwork;

/**
 * 获取服务器图片地址的方法
 */
import baseConfig from "@/utils/config.js";
Vue.prototype.$staticImagePath = function (path) {
	return baseConfig.imageURL + path;
};
/**
 * oss地址
 */
Vue.prototype.$getImageURL = function (url) {
	if (typeof url === "string") {
		if (url.startsWith("http")) {
			return url;
		} else if (url.startsWith("data:image")) {
			return url;
		}
		return baseConfig.ossURL + url;
	} else {
		return url;
	}
};
/**
 * 防抖函数
 */
var debounceTimer = null;
Vue.prototype.$debounce = function(func, delay = 1000) {
	if (debounceTimer !== null) {
		clearTimeout(debounceTimer);
	}
	debounceTimer = setTimeout(() => {
		typeof func === "function" && func();
	}, delay);
};
/**
 * 节流函数
 */
var throttleTimer = false;
Vue.prototype.$throttle = function(func, delay = 3000) {
	if (throttleTimer === true) {
		return;
	}
	throttleTimer = true;
	setTimeout(() => {
		throttleTimer = false;
	}, delay)
	typeof func === "function" && func();
};

/**
 * 辅助方法
 */
import func from '@/utils/func.js'
Vue.prototype.$func = func;

// /**
//  * 导航栏
//  */
// import navigationBar from "@/components/navigationBar/navigationBar.vue";
// Vue.component("navigationBar", navigationBar);
// import bgImg from '@/components/navigationBar/bgImg.vue'
// Vue.component("bgImg", bgImg);

// /**
//  * 没有数据的空白占位
//  */
// import uEmpty from "@/components/emptyData/emptyData.vue";
// Vue.component("uEmpty", uEmpty);

/**
 * 全局的业务拦截 1.2.0
 * @深圳前海万联科技有限公司 <www.wanlshop.com>
 */
// 1.1.6升级
uni.addInterceptor("uploadFile", {
	invoke(config) {
		if (checkURL(config.url)) {
			config.header = typeof config.header == "object" ? config.header : {};
			// 获取缓存Token
			if (uni.getStorageSync("wanlshop:user")) {
				config.header.token = uni.getStorageSync("wanlshop:user").token;
			}
		} else {
			config.header = typeof config.header == "object" ? config.header : {};
			// 获取签名Sign
			config.header["Sign"] = md5(
				`/api${config.url}?${parseParams(
					ksort({
						...(typeof config.data == "object" ? config.data : {}),
						appKey: md5(wanlshop_config.socketurl),
					})
				)}`
			);
			// URL拼接
			config.url = wanlshop_config.appurl.replace(/([\w\W]+)\/$/, "$1") + config.url;
			// 获取客户端
			// #ifdef APP-PLUS
			config.header.uuid = plus.device.uuid;
			config.header["App-Client"] = "app-wanlshop";
			// #endif
			// #ifdef H5
			if (jssdk.isWechat()) {
				config.header["App-Client"] = "wechat-wanlshop";
			} else {
				config.header["App-Client"] = "h5-wanlshop";
			}
			// #endif
			// #ifdef MP
			config.header["App-Client"] = "mp-wanlshop";
			// #endif
			// 设置语言
			config.header["Accept-Language"] = "zh-CN,zh;q=0.9";
		}
	},
	success(res) {
		if (res.statusCode !== 200) {
			uni.showToast({
				title: JSON.parse(res.data).msg,
				icon: "error",
				position: true,
			});
			return true;
		} else {
			// uni.showToast({
			// 	title: "图片上传成功",
			// 	position: true,
			// });
			return true;
		}
	},
});
uni.addInterceptor("request", {
	invoke(config) {
		// 关闭证书验证
		config.sslVerify = false;
		// request 触发前拼接 url
		if (checkURL(config.url)) {
			config.url = config.url;
		} else {
			config.header = typeof config.header == "object" ? config.header : {};
			// 获取签名Sign
			config.header["Sign"] = md5(
				`/api${config.url}?${parseParams(
					ksort({
						...(typeof config.data == "object" ? config.data : {}),
						appKey: md5(wanlshop_config.socketurl),
					})
				)}`
			);
			// URL拼接
			config.url = wanlshop_config.appurl.replace(/([\w\W]+)\/$/, "$1") + config.url;
			// 获取缓存Token
			if (stoarge.getToken()) {
				config.header.token = stoarge.getToken();
			}
			// 获取客户端
			// #ifdef APP-PLUS
			config.header.uuid = plus.device.uuid;
			config.header["App-Client"] = "app-wanlshop";
			// #endif
			// #ifdef H5
			if (jssdk.isWechat()) {
				config.header["App-Client"] = "wechat-wanlshop";
			} else {
				config.header["App-Client"] = "h5-wanlshop";
			}
			// #endif
			// #ifdef MP
			config.header["App-Client"] = "mp-wanlshop";
			// #endif
			// 设置语言
			config.header["Accept-Language"] = "zh-CN,zh;q=0.9";
		}
		if (wanlshop_config.debug) {
			console.log("invoke-success", config);
		}
	},
	success(res) {
		if (res.statusCode == 200 && res.errMsg == "request:ok") {
			// 加载成功 1.1.6升级
			res.res = res.data;
			if (res.data.code == 1) {
				res.data = res.res.data;
				res.msg = res.res.msg;
				return true;
			} else if (res.data.code == 4) {
				return true;
			} else if (res.data.status == 0 || res.data.status == 1) {
				// 屏蔽其他第三方报错
			} else {
				uni.showToast({
					title: res.data.msg,
					icon: "error",
					position: true,
				});
				return true;
			}
			if (wanlshop_config.debug) {
				console.log("request-success", res);
			}
		} else {
			if (res.statusCode === 402) {
				res.res = res.data;
				return true;
			} else if (res.statusCode == 401) {
				uni.showToast({
					title: res.data.msg,
					icon: "error",
					position: true,
				});
				stoarge.logout();
				to("/pages/login/login?from=request");
			} else if (res.statusCode == 404) {
				uni.showToast({
					title: "API 接口不存在",
					icon: "error",
					position: true,
				});
			} else if (res.statusCode == 500) {
				uni.showToast({
					title: "API  服务器繁忙",
					icon: "error",
					position: true,
				});
			} else {
				uni.showToast({
					title: res.data.msg,
					icon: "error",
					position: true,
				});
			}
			if (wanlshop_config.debug) {
				console.log("request-fail", res);
			}
			return true;
		}
	}
});

/**
 * 获取系统信息
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 */
const wanlsys = () => {
	const sys = uni.getSystemInfoSync();
	const data = {
		top: sys.statusBarHeight,
		height: sys.statusBarHeight + uni.upx2px(90),
		screenHeight: sys.screenHeight,
		platform: sys.platform,
		model: sys.model,
		windowHeight: sys.windowHeight,
		windowBottom: sys.windowBottom,
		deviceId: sys.deviceId,
	};
	// // #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-TOUTIAO || MP-WEIXIN
	// const custom = uni.getMenuButtonBoundingClientRect();
	// data.height = custom.bottom + custom.top - sys.statusBarHeight;
	// // #endif
	// #ifdef MP-ALIPAY
	data.height = sys.statusBarHeight + sys.titleBarHeight;
	// #endif
	return data;
};


/**
 * 获取图片完整地址
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 *
 * @param {Object} url 提示标题，不需要OSS处理
 */
const appstc = (url) => {
	return wanlshop_config.cdnurl + "/assets/addons/wanlshop/img" + url;
};

/**
 * MD5
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 *
 * @param {Object} data 数据
 */
const md5 = (data) => {
	return md5Libs.md5(data);
};

/**
 * 数字格式化
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 *
 * @param {Object} number 数字
 * @param {Object} type 类型 thousand:万,hundred:百
 */
const toFormat = (number, type) => {
	//格式千位以上
	if (type == "thousand") {
		if (number > 9999) {
			number = (number / 10000).toFixed(1) + "w";
		} else if (number > 999) {
			number = (number / 1000).toFixed(1) + "k";
		}
	}
	//格式百位
	if (type == "hundred" && number > 99) {
		number = "99+";
	}
	return number;
};

/**
 * 加法精度计算
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 *
 * @param {Object} number 数字
 */
const bcadd = (a, b) => {
	return wanlshop_function.bcadd(a, b);
};

/**
 * 减法精度计算
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 *
 * @param {Object} number 数字
 */
const bcsub = (a, b) => {
	return wanlshop_function.bcsub(a, b);
};

/**
 * 乘法精度计算
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 *
 * @param {Object} number 数字
 */
const bcmul = (a, b) => {
	return wanlshop_function.bcmul(a, b);
};

/**
 * 除法精度计算
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 *
 * @param {Object} number 数字
 */
const bcdiv = (a, b) => {
	return wanlshop_function.bcdiv(a, b);
};

/**
 * 判断是否为完整地址
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 */
const checkURL = (url) => {
	var str = url;
	//判断URL地址的正则表达式为:http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?
	//下面的代码中应用了转义字符"\"输出一个字符"/"
	var Expression = /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/;
	var objExp = new RegExp(Expression);
	if (objExp.test(str) == true) {
		return true;
	} else {
		return false;
	}
};

/**
 * 对象按字母正序排列返回
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 */
const ksort = (o) => {
	let sorted = {};
	Object.keys(o)
		.sort()
		.map((key) => {
			sorted[key] = o[key];
		});
	return sorted;
};

/**
 * 对象转URL 1.1.9升级 scene不转码
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 */
const parseParams = (data) => {
	try {
		var tempArr = [];
		for (var i in data) {
			var key = encodeURIComponent(i);
			var value = key == "scene" ? data[i] : encodeURIComponent(data[i]);
			tempArr.push(key + "=" + value);
		}
		var urlParamsStr = tempArr.join("&");
		return urlParamsStr;
	} catch (err) {
		return "";
	}
};

/**
 * URL转对象
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 */
const getParam = (url) => {
	var pms = {},
		keyValue = url.indexOf("?") != -1 ? url.split("?")[1].split("&") : url.split("&");
	for (var i = 0; i < keyValue.length; i++) {
		var item = keyValue[i].split("=");
		var key = item[0];
		var value = item[1];
		pms[key] = value;
	}
	return pms;
};

/**
 * 时间格式化
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 *
 * @param String timestamp 时间戳
 * @param String fmt 返回的时间格式
 * yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
 */
const timeFormat = (timestamp = null, fmt = "yyyy-mm-dd") => {
	// 其他更多是格式化有如下:
	// yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
	timestamp = parseInt(timestamp);
	// 如果为null,则格式化当前时间
	if (!timestamp) timestamp = Number(new Date());
	// 判断用户输入的时间戳是秒还是毫秒,一般前端js获取的时间戳是毫秒(13位),后端传过来的为秒(10位)
	if (timestamp.toString().length == 10) timestamp *= 1000;
	let date = new Date(timestamp);
	let ret;
	let opt = {
		"y+": date.getFullYear().toString(), // 年
		"m+": (date.getMonth() + 1).toString(), // 月
		"d+": date.getDate().toString(), // 日
		"h+": date.getHours().toString(), // 时
		"M+": date.getMinutes().toString(), // 分
		"s+": date.getSeconds().toString(), // 秒
		// 有其他格式化字符需求可以继续添加，必须转化成字符串
	};
	for (let k in opt) {
		ret = new RegExp("(" + k + ")").exec(fmt);
		if (ret) {
			fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
		}
	}
	return fmt;
};

/**
 * 社交时间友好
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 *
 * @param String timestamp 时间戳
 * @param String | Boolean format 如果为时间格式字符串，超出一定时间范围，返回固定的时间格式；
 * 如果为布尔值false，无论什么时间，都返回多久以前的格式
 */
const timeToDate = (timestamp = null, format = "yyyy-mm-dd") => {
	if (timestamp == null) timestamp = Number(new Date());
	timestamp = parseInt(timestamp);
	// 判断用户输入的时间戳是秒还是毫秒,一般前端js获取的时间戳是毫秒(13位),后端传过来的为秒(10位)
	if (timestamp.toString().length == 10) timestamp *= 1000;
	var timer = new Date().getTime() - timestamp;
	timer = parseInt(timer / 1000);
	// 如果小于5分钟,则返回"刚刚",其他以此类推
	let tips = "";
	switch (true) {
		case timer < 300:
			tips = "刚刚";
			break;
		case timer >= 300 && timer < 3600:
			tips = parseInt(timer / 60) + "分钟前";
			break;
		case timer >= 3600 && timer < 86400:
			tips = parseInt(timer / 3600) + "小时前";
			break;
		case timer >= 86400 && timer < 2592000:
			tips = parseInt(timer / 86400) + "天前";
			break;
		default:
			// 如果format为false，则无论什么时间戳，都显示xx之前
			if (format === false) {
				if (timer >= 2592000 && timer < 365 * 86400) {
					tips = parseInt(timer / (86400 * 30)) + "个月前";
				} else {
					tips = parseInt(timer / (86400 * 365)) + "年前";
				}
			} else {
				tips = timeFormat(timestamp, format);
			}
	}
	return tips;
};

/**
 * IM时间友好
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 *
 * @param String timestamp 时间戳
 * @param String | Boolean format 如果为时间格式字符串，超出一定时间范围，返回固定的时间格式；
 * 如果为布尔值false，无论什么时间，都返回多久以前的格式
 */
const timeToChat = (timestamp = null) => {
	if (timestamp == null) timestamp = Number(new Date());
	timestamp = parseInt(timestamp);
	// 判断用户输入的时间戳是秒还是毫秒,一般前端js获取的时间戳是毫秒(13位),后端传过来的为秒(10位)
	if (timestamp.toString().length == 10) timestamp *= 1000;
	var timer = new Date().getTime() - timestamp;
	timer = parseInt(timer / 1000);
	// 如果小于5分钟,则返回"刚刚",其他以此类推
	let tips = "";
	switch (true) {
		case timer < 86400:
			tips = timeFormat(timestamp, "hh:MM");
			break;
		case timer >= 86400 && timer < 86400 * 7:
			var now = new Date(timestamp);
			var week = ["日", "一", "二", "三", "四", "五", "六"];
			switch (new Date().getDate() - now.getDate()) {
				case 1:
					tips = timeFormat(timestamp, "昨天 hh:MM");
					break;
				case 2:
					tips = timeFormat(timestamp, "前天 hh:MM");
					break;
				default:
					tips = "星期" + week[now.getDay()] + timeFormat(timestamp, "hh:MM");
			}
			break;
		case timer >= 86400 * 7:
			tips = timeFormat(timestamp, "mm-dd hh:MM");
			break;
		default:
			tips = timeFormat(timestamp, "yyyy-mm-dd hh:MM");
	}
	return tips;
};

/**
 * 图像处理
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 * @param {Object} url 图像地址
 * @param {Object} h  高度
 * @param {Object} w  宽度
 * @param {Object} modenum 1.自适应 2.固定宽高短边缩放 3.固定宽高居中裁剪 4.强制宽高
 * @param {Object} type  使用类型
 * @param {Object} format  图形格式
 * @param {Object} resize  resize
 * @param {Object} multiple  放大倍数
 *
 * $wanlshop.oss(url, 120, 0, 2, 'transparent', 'png')
 */
const oss = (url, w = 120, h = 120, modenum = 2, type = "", format = "jpg", resize = "resize", multiple = 3) => {
	let image = "";
	let mode = ["m_lfit", "m_mfit", "m_fill", "m_fixed"];
	// 图像，自适应方向：1，渐进显示：1，转换格式：jpg，图片质量：q_90，图片锐化：50，浓缩图
	let rule = [
		"?x-oss-process=image",
		"auto-orient,1",
		"interlace,1",
		"format,jpg",
		"quality,q_90",
		"sharpen,50",
		"resize,m_fixed,w_120,h_120",
	];
	// 转换格式
	if (format == "png") {
		rule[3] = ["format", "png"].join(",");
	}
	// 判断是否有高度
	if (w == 0) {
		rule[6] = [resize, mode[modenum], `h_${h * multiple}`].join(",");
	} else if (h == 0) {
		rule[6] = [resize, mode[modenum], `w_${w * multiple}`].join(",");
	} else {
		rule[6] = [resize, mode[modenum], `w_${w * multiple}`, `h_${h * multiple}`].join(",");
	}
	//当地址不存在
	if (url) {
		if (/^data:image\//.test(url)) {
			image = url;
		} else if (/^(http|https):\/\/.+/.test(url)) {
			rule.pop();
			image = type == "video" ? url : url + rule.join("/");
		} else {
			image = type == "video" ? wanlshop_config.cdnurl + url : wanlshop_config.cdnurl + url + rule.join("/");
		}
	} else {
		if (type == "transparent") {
		} else if (type == "avatar") {
			image = appstc("/common/mine_def_touxiang_3x.png");
		} else {
			image = appstc("/common/img_default3x.png");
		}
	}
	return image;
};

/**
 * 页面跳转
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 *
 * @param {Object} url 需要跳转的应用内非 tabBar 的页面的路径
 * @param {Object} animationType 窗口显示的动画效果
 * @param {Object} animationDuration 窗口动画持续时间，单位为 ms
 */
const to = (url, animationType = "pop-in", animationDuration = 300) => {
	uni.navigateTo({
		url,
		animationType,
		animationDuration,
		success: function (res) {
			wanlshop_config.debug ? console.log(res) : "";
		},
		fail: function (e) {
			wanlshop_config.debug ? console.log(e) : "";
		},
	});
};


/**
 * 打开任意链接
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 *
 * @param {Object} url 页面地址
 */
const on = (url) => {
	url = decodeURIComponent(url);
	// 关闭所有页面，跳转链接
	if (
		url == "/pages/tabBar/home" ||
		url == "/pages/tabBar/shopping" ||
		url == "/pages/tabBar/message" ||
		url == "/pages/tabBar/cart" ||
		url == "/pages/tabBar/mine"
	) {
		uni.switchTab({
			url: url,
		});
	} else {
		to(url);
	}
};

/**
 * 发送消息
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 *
 * @param {JSON} data 页面地址
 */
const send = (data) => {
	//将发送保存本地
	uni.request({
		url: "/wanlshop/chat/send",
		method: "POST",
		data: data,
		success: (res) => {
			wanlshop_function.setChat(data, "send");
		},
	});
};


/**
 * 格式化kb
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 *
 * @param {JSON} limit kb
 */
const conver = (limit, unit = true) => {
	return (limit / (1024 * 1024)).toFixed(1) + (unit ? "MB" : "");
};

/**
 * 获取配置
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 *
 * @param {JSON} name 配置名称
 */
const config = (name) => {
	return wanlshop_config[name];
};

const showImg = (url = "") => {
	if (!url) return "";
	if (url.indexOf("http") === 0) return url;
	// if (url.indexOf('/') === 0) url = url.slice(1)
	if (url[0] !== "/") url = "/" + url;
	return baseConfig.imageURL + url;
};

const xcxImg = (url = "") => {
	return showImg("xcx_img" + url);
};
Vue.prototype.$showImg = showImg;
Vue.prototype.$xcxImg = xcxImg;

/**
 * WanlShop 全局方法
 * @author 深圳前海万联科技有限公司 <www.wanlshop.com>
 *
 * @method $wanlsys 系统配置
 * @method $appstc 服务器图片地址
 * @method $toFormat 数字格式化
 * @method $timeToDate 社交时间友好
 * @method $timeToChat IM时间友好
 * @method $timeFormat 时间格式化
 * @method $oss OSS图片处理
 * @method $to 打开链接
 * @method $on 打开任意链接
 * @method $auth 认证页面
 * @method $send 发送消息
 * @method $phone 拨打电话
 * @method $con 获取配置
 *
 */
Vue.prototype.$wanlshop = {
	wanlsys,
	appstc,
	toFormat,
	timeToDate,
	timeToChat,
	timeFormat,
	conver,
	md5,
	oss,
	to,
	on,
	send,
	config,
	bcadd,
	bcsub,
	bcmul,
	bcdiv,
	parseParams,
	getParam,
};

// 全局订单详情
Vue.prototype.orderDetails = function (order_id) {
	to(`/pages/user/order/details?id=${order_id}`);
};


// 全局店铺链接
Vue.prototype.onShopGoods = function (id) {
	to(`/pages/shop/product/list?shop_id=${id}`);
};

//  全局物流动态
Vue.prototype.onLogistics = function (order_id) {
	to(`/pages/user/order/logistics?id=${order_id}`);
};

// 全局联系方式 1.0.2升级
Vue.prototype.toChat = function (shop_id, goods = null) {
	goods
		? to(`/pages/notice/chat?shop_id=${shop_id}&goods=${JSON.stringify(goods)}`)
		: to(`/pages/notice/chat?shop_id=${shop_id}`);
};


// 打开广告
Vue.prototype.onAdvert = function (data) {
	data.url && !/^(http|https):\/\/.+/.test(data.url) ? on(data.url) : to(`/pages/article/advert?id=${data.id}`);
};

// 打开发现
Vue.prototype.onFind = function (data, comments = null) {
	if (data.type == "video") {
		to(`/pages/apps/find/details/video?id=${data.id}`);
	} else {
		if (comments) {
			to(`/pages/apps/find/details/details?id=${data.id}&afferent=comments`);
		} else {
			to(`/pages/apps/find/details/details?id=${data.id}`);
		}
	}
};

App.mpType = "app";
const app = new Vue({
	store,
	...App,
});
app.$mount();
